package com.googlecode.horncomb.web.extremetable.util;

import java.util.HashMap;
import java.util.Map;

import com.googlecode.horncomb.bean.filter.ConditionSet;

public class ExTabConditionSet implements ConditionSet {
	private Map<String, ExTabConditionToken> conditionTokenMap = new HashMap<String, ExTabConditionToken>();
	private Map<String, Object> conditionValueMap = new HashMap<String, Object>();

	public ExTabConditionSet() {
		super();
	}

	public ExTabConditionSet(Map<String, ExTabConditionToken> map) {
		super();
		this.conditionTokenMap = map;
	}

	public ExTabConditionSet addConstraint(ExTabConditionToken token) {
		this.conditionTokenMap.put(token.getProperty(), token);
		this.conditionValueMap.put(token.getProperty(), token.getValue());
		return this;
	}

	/**
	 * @return the conditionTokenMap
	 */
	public Map<String, ExTabConditionToken> getConditionTokenMap() {
		return conditionTokenMap;
	}

	public Map<String, Object> getConstraintsMap() {
		return conditionValueMap;
	}

	public boolean isEmpty() {
		return conditionTokenMap.isEmpty();
	}
}
